<?php

require_once("include_db.php");
require_once("include_functions.php");
require_once("include_header.php");

?>
   <div id="bd" role="main">
        <div class="yui-g">

<?php
if(!isset($_POST['submit'])){
?>

<form method="post" action="add_worker.php">
	Worker Name: <input type="text" name="workerName" /><br />
	Worker Email: <input type="text" name="workerEmail" /><br />
	<input type="submit" name="submit" value="submit">
	<input type="reset" name="reset">
</form>

<?php
} else {
	$workerName = clean($_POST['workerName']);
	$workerEmail = clean($_POST['workerEmail']);
	$sql =	"INSERT INTO workers SET ".
		"workerName = '{$workerName}', ".
		"workerEmail = '{$workerEmail}'";
	if(!$result = mysql_query($sql)) echo mysql_error();
	printf("Worker %s inserted into database", $workerName);
}
?>
	</div>
	</div>

<?php
require_once("include_footer.php");
?>
